<?php

namespace app\exam\validate;

use think\Validate;

/**
 * 试题验证
 */
class Topic extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'topic_id'      => 'require|/^[\d,]+$/',
        'origin'        => 'require|number',

    ];

    protected $field = [
        'topic_id'      => '试题',
        'origin'     	=> '试题来源',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [
        
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'topic_info'     	=> ['topic_id', 'origin'],
    ];


}
